function lengthOfLIS(nums: number[]): number {
  let numsLen = nums.length
  
  let arr = new Array(numsLen).fill(1)
  for (let i = 0; i < numsLen; i++) {
      let lens = [1]
      for (let j = 0; j < i; j++) {
          if (nums[i] > nums[j]) {
              lens.push(arr[j] + 1)
          }
      }
      arr[i] = Math.max(...(lens))
  }
  console.log(arr)
  return arr.length == 0 ? 0 : Math.max(...arr)
};

console.log(lengthOfLIS([10,9,2,5,3,7,101,18]))